package main

func main() {

}

type WordDictionary struct {
	Words []string
}

func Constructor() WordDictionary {
	return WordDictionary{
		Words: make([]string, 0),
	}
}

func (this *WordDictionary) AddWord(word string) {
	this.Words = append(this.Words, word)
}

func (this *WordDictionary) Search(word string) bool {
	nW := len(word)
	for _, w := range this.Words {
		pri := 0
		n := len(w)
		if n != nW {
			continue
		}
		for i := range w {
			if word[i] == '.' {
				pri++
				continue
			} else if w[i] == word[i] {
				pri++
				continue
			} else {
				break
			}
		}
		if n == pri {
			return true
		}
	}
	return false
}
